from media.lib.views import FileUploadFormMixin
from .lib import (
   HTMXProjectSubCreateFormView,
   HTMXProjectSubUpdateFormView,
   ProjectSubDetailView,
   ProjectSubListView,
   template_path,
)

from .. import forms, models

class EthicalReviewListView(ProjectSubListView):
    template_name = template_path("ethical_review/list.html")

class EthicalReviewCreateView(
    FileUploadFormMixin,
    HTMXProjectSubCreateFormView
):
    form_class = forms.EthicalReviewForm
    template_name = template_path("detail_form_base.html")
    create_view_name = "project:ethical_review/create"
    detail_view_name = "project:ethical_review/detail"


class EthicalReviewDetailView(ProjectSubDetailView):
    model = models.EthicalReview
    form_class = forms.EthicalReviewForm
    template_name = template_path("ethical_review/detail.html")
        

class EthicalReviewUpdateView(
    FileUploadFormMixin,
    HTMXProjectSubUpdateFormView
):
    model = models.EthicalReview
    form_class = forms.EthicalReviewForm
    update_view_name = "project:ethical_review/update"
    detail_view_name = "project:ethical_review/detail"
    
